<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>

	
<title>悦章科技机构平台</title>	

	
<!--内容样式-->
<link rel="stylesheet" href="__PUBLIC__/Home/css/style.css" />

<script src="/Public/static/jquery-2.0.3.min.js"></script>
	
	
</head>

<body>

	
	<div class="main">
	
	
		<!--  头部  -->
		<include file="menu"/>
		
		
		

		
		
		<!--  右侧内容  -->
		<div class="content">
			
			
			<div class= "ct-title">
				<div class="ctt-bt">新增帐号</div>
				<div class="divclear"></div>
			</div>
			
			<div class="ct-xz">
				<div class="ctx-box">
					<div class="ctxb-l">姓名：</div>
					<div class="ctxb-r">
						<input type="text" class="ctxbr-wb" placeholder="请输入姓名" name="name">
					</div>
					<div class="divclear"></div>
				</div>
				<div class="ctx-box">
					<div class="ctxb-l">帐号：</div>
					<div class="ctxb-r">
						<input type="text" class="ctxbr-wb" placeholder="请输入手机号做为帐号" name="mobile">
					</div>
					<div class="divclear"></div>
				</div>
				<div class="ctx-box">
					<div class="ctxb-l">登录密码：</div>
					<div class="ctxb-r">
						<input type="password" class="ctxbr-wb" placeholder="请输入登录密码" name="password">
					</div>
					<div class="divclear"></div>
				</div>
				<div class="ctx-box">
					<div class="ctxb-l">确认密码：</div>
					<div class="ctxb-r">
						<input type="password" class="ctxbr-wb" placeholder="请重复输入登录密码" name="confirm_password">
					</div>
					<div class="divclear"></div>
				</div>
				<div class="divclear"></div>
				<div class="ctx-box" style="width: 100%;">
					<div class="ctxb-l">权限设置：</div>
					<div class="ctxb-qx">
						<label class="ctxbq-t t1">
							<input type="checkbox">
							<span>招生系统</span>
							<div class="divclear"></div>
						</label>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction[]" value="1">
								<span>数据统计</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction[]" value="2">
								<span>排行榜</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction[]" value="3">
								<span>线索列表</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction[]" value="4">
								<span>客户列表</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction[]" value="5">
								<span>跟进记录</span>
								<div class="divclear"></div>
							</label>
						</div>
					</div>
					<div class="ctxb-qx">
						<label class="ctxbq-t t2">
							<input type="checkbox">
							<span>教务系统</span>
							<div class="divclear"></div>
						</label>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction1[]" value="6">
								<span>学习统计</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction1[]" value="7">
								<span>学生管理</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction1[]" value="8">
								<span>班级分类</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction1[]" value="9">
								<span>班级列表</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction1[]" value="10">
								<span>在线成绩</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction1[]" value="11">
								<span>错题汇总</span>
								<div class="divclear"></div>
							</label>
						</div>
					</div>
					<div class="ctxb-qx">
						<label class="ctxbq-t t3">
							<input type="checkbox">
							<span>财务系统</span>
							<div class="divclear"></div>
						</label>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction2[]" value="12">
								<span>财务统计</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction2[]" value="13">
								<span>交易管理</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction2[]" value="14">
								<span>收费管理</span>
								<div class="divclear"></div>
							</label>
						</div>
					</div>
					<div class="ctxb-qx">
						<label class="ctxbq-t t4">
							<input type="checkbox">
							<span>运营系统</span>
							<div class="divclear"></div>
						</label>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction3[]" value="15">
								<span>内容统计</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b"  >
								<input type="checkbox" value="16" name="jurisdiction3[]">
								<span>直播课管理</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction3[]" value="17">
								<span>点播课管理</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction3[]" value="18">
								<span>面授课管理</span>
								<div class="divclear"></div>
							</label>
						</div>
					</div>
					<div class="ctxb-qx">
						<label class="ctxbq-t t5">
							<input type="checkbox">
							<span>营销系统</span>
							<div class="divclear"></div>
						</label>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction4[]" value="19">
								<span>课程拼团</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction4[]" value="20">
								<span>课程秒杀</span>
								<div class="divclear"></div>
							</label>
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction4[]" value="21">
								<span>优惠券管理</span>
								<div class="divclear"></div>
							</label>
						</div>
					</div>
					<div class="ctxb-qx">
						<label class="ctxbq-t t6">
							<input type="checkbox">
							<span>课程代购</span>
							<div class="divclear"></div>
						</label>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction5[]" value="22">
								<span>代购记录</span>
								<div class="divclear"></div>
							</label>
						</div>
					</div>
<!-- 					<div class="ctxb-qx">
						<label class="ctxbq-t t7">
							<input type="checkbox">
							<span>机构管理</span>
							<div class="divclear"></div>
						</label>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction6[]" value="23">
								<span>信息设置</span>
								<div class="divclear"></div>
							</label>
						</div>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction6[]" value="24">
								<span>账号权限</span>
								<div class="divclear"></div>
							</label>
						</div>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction6[]" value="25">
								<span>师资力量</span>
								<div class="divclear"></div>
							</label>
						</div>
						<div class="ctxbq-nr">
							<label class="ctxbqn-b">
								<input type="checkbox" name="jurisdiction6[]" value="26">
								<span>意见反馈</span>
								<div class="divclear"></div>
							</label>
						</div>
					</div> -->
					<div class="divclear"></div>
				</div>
				<div class="divclear"></div>
				<div class="ctx-btn" id="qr">确认</div>
			</div>
			
			
		</div>
		
		
		
	</div>
		
		
	
	
	
	
	
	
</body>
</html>

<script type="text/javascript">
	$('.ctxbq-t88').click(function(){
		if($(':checkbox').prop('checked')){
		   $(':checkbox').prop('checked',true);
		}else{
		   $(':checkbox').prop('checked',false);
		}
	})
	$('.t1').click(function(){
		// console.log($(this).children());return false;
		$("input[name='jurisdiction[]']").prop("checked", $(this).children().prop("checked"));
	})
	$('.t2').click(function(){
		// console.log($(this).children());return false;
		$("input[name='jurisdiction1[]']").prop("checked", $(this).children().prop("checked"));
	})
	$('.t3').click(function(){
		// console.log($(this).children());return false;
		$("input[name='jurisdiction2[]']").prop("checked", $(this).children().prop("checked"));
	})
	$('.t4').click(function(){
		// console.log($(this).children());return false;
		$("input[name='jurisdiction3[]']").prop("checked", $(this).children().prop("checked"));
	})
	$('.t5').click(function(){
		// console.log($(this).children());return false;
		$("input[name='jurisdiction4[]']").prop("checked", $(this).children().prop("checked"));
	})
	$('.t6').click(function(){
		// console.log($(this).children());return false;
		$("input[name='jurisdiction5[]']").prop("checked", $(this).children().prop("checked"));
	})
	$('.t7').click(function(){
		// console.log($(this).children());return false;
		$("input[name='jurisdiction6[]']").prop("checked", $(this).children().prop("checked"));
	})
	$('#qr').click(function(){
		var checked=[];
		$('input:checkbox:checked').each(function(){
			var b=$(this).val() ;
			if(b == 'on'){

			}else{
				checked.push($(this).val());
			}
			
		})
		var name=$("input[name='name']").val();
		var mobile=$("input[name='mobile']").val();
		var password=$("input[name='password']").val();
		var confirm_password=$("input[name='confirm_password']").val();
		if(password !== confirm_password){
			alert('确认密码跟密码不一致');return false;
		}
        $.ajax({
            url:"{:U('Mechanism/account_add')}",
            data:{checked:checked,name:name,mobile:mobile,password:password},
            dataType:'json',
            type:'post',
            success:function(data){
            	if(data.result==1){
            		alert('成功');
        		    var url = "{:U('Mechanism/account_authority')}";
            		location.href=url;
            	}else{
            		alert('失败');
            		var url = "{:U('Mechanism/account_authority')}";
            		location.href=url;
            	}
            }
        })
	})
</script>